
// ---------------------   左上task8 面积图  --------------------------------------
function market1a(market_name = '华冠超市') {
    $.post('http://127.0.0.1:5000/data-api/task1a', {market_name: market_name}).done(function (data) {
        var myChart = echarts.init(document.querySelector(".leftUp .domz .chart1"));
        var option = {
            tooltip: {},
            title:{
                text:'各省水果销量',
                left:'center',
                textStyle: {
                        fontSize:12,
                        color: '#f3f3f3'
                    },
            },
            grid:{
                left: '2%',
                right: '2%',
                bottom: '2%',
                top: '13%',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: data['index'],
                axisLabel: {
                    color: '#d5d5d5',
                    interval: 0,
                    rotate: 45,
                    fontSize:10,
                },
                axisTick: { show: false}
            },
            yAxis: {
                type: 'value',
                // min: 0,
                // max: 5000000,
                min: function (value) {
                    return value.min;
                    },
                max: function (value) {
                    return value.max;
                },
                axisLabel: {
                    formatter:function(value){
                           return (value/10000).toFixed(0)+'万'
                        },
                    textStyle: {
                        color: '#d5d5d5'
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255, .2)'
                    }
                }
            },
            series: [
                {
                    type: 'scatter',
                    symbolSize: 6,
                    data: data['data'],
                    itemStyle: {
                    color: '#92dcd7'
                    }
                }
            ]
        };
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });
}

// 启动|刷新 浏览器调用
market1a();
